package com.jch.Dao;

import com.entity.Sendsms;

import java.sql.ResultSet;
import java.sql.SQLException;

public class SendsmsDao extends BaseDao {
    public  int InsertValues(Object...params){
        String sql="insert into sendsms(phoneNum,random) values(?,?)";

        try {
            int i = queryRunner.update(sql, params);
            return i;
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return 0;
    }

    public Sendsms querySendsms(Object...params) {
        String sql = "select * from sendsms where phoneNum=?";
        return findBean(Sendsms.class, sql, params);
    }

    public int deleteSendsms(String random) {
        String sql = "delete from sendsms where random=?";
        Object[] params = {random};
        return update(sql, params);
    }
    public int updateSendsmsRandom(Object...params) {
        String sql = "update sendsms set random=?  where phoneNum=?";
        return update(sql, params);
    }

}
